// var bolehemail = false;
// var bolehavatar = false;

function validateEmail(){
	var bolehemail = false;
		
	document.getElementById('error-email').style.height = "30px";
	var formatemail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,})$/;
	if (!formatemail.test(document.getElementById('form-email').value)) {
		document.getElementById('error-email').innerHTML = "Format email salah";
	} else {
		document.getElementById('error-email').style.height = "1px";
		document.getElementById('error-email').innerHTML = "";
		bolehemail = true;
	}
	

}

function validateAva(){
	var bolehavatar = false;
	
	document.getElementById('error-avatar').style.height = "30px";
	if (!checkext(document.getElementById('form-avatar').value)) {
		document.getElementById('error-avatar').innerHTML = "Tipe file harus ber ekstensi .jpg atau .jpeg";
	} else {
		document.getElementById('error-avatar').style.height = "1px";
		document.getElementById('error-avatar').innerHTML = "";
		bolehavatar = true;
	}
	
}

